import { createSlice, PayloadAction } from "@reduxjs/toolkit"
interface AppState {
	language: string
	animateDownload: boolean
}

const initialState: AppState = {
	language: "en",
	animateDownload: false
}

const appSlice = createSlice({
	name: "app",
	initialState,
	reducers: {
		setLanguage(state, action: PayloadAction<string>) {
			state.language = action.payload
		},
		setAnimateDownload(state, action: PayloadAction<boolean>) {
			console.log("animate", action.payload)
			state.animateDownload = action.payload
		}
	}
})

export const { setLanguage, setAnimateDownload } = appSlice.actions

export default appSlice.reducer
